package books.ThinkingInJava.src.Chapter18;

import books.ThinkingInJava.src.Tools.FileKit;
import books.ThinkingInJava.src.Tools.Output;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.BasicFileAttributeView;
import java.nio.file.attribute.BasicFileAttributes;

/**
 * @author bloodcolding
 * @since 12/26/2018 11:28 AM
 */
public class GainFileInformation {
    public static void main(String[] args) throws IOException {
        Path path = Paths.get(FileKit.filePathTransfer("D:\\Doc\\Test"));
        BasicFileAttributeView basicFileAttributeView = Files.getFileAttributeView(path, BasicFileAttributeView.class);
        BasicFileAttributes basicFileAttributes = basicFileAttributeView.readAttributes();
        Output.println(basicFileAttributes.creationTime());
        Output.println(new Long(basicFileAttributes.size()));
    }
}

